Some conventional timer managers implement a binary heap. Each element in the binary heap represents a single expiration time. The expiration times are presented as a one-dimensional linear array. The array stores the expiration times according to the following properties and equations:                A root of the heap is located at array index 0, and        A node at array index N:                    Has a “left child” at array index 2N+1;            Has a “right child” at array index 2N+2; and            Has a parent at array index floor((N−1)/2).                        
The timer manage commonly support large streams of request to create a new timer and delete an existing timer. Two sort procedures are used to implement the create requests and the delete requests. A bubble-up sort procedure is used when an element is added to the heap. The steps of the bubble-up procedure are as follows:
Step 1. Add a new element to an empty heap location next to a current “tail of the heap”. The tail of the heap is located at a bottom level of the heap in accordance with a shape property of the heap.
Step 2. Compare the element being sorted with a parent of the element according to a comparison predicate. If the heap property criteria is satisfied, sorting is complete.
Step 3. If not, swap the heap location of the element being sorted and the parent and continue with step 2.
A bubble-down sort procedure occurs as a side-effect of removing the element at the root of the heap. The steps of the bubble-down procedure are as follows:
Step 1. Move the element currently located at the tail of the heap to the root of the heap.
Step 2. Declare the root as an element being sorted.
Step 3. Compare the two children of the element being sorted to each other according to the comparison predicate.
Step 4. Compare the “winning child” from step 3 to the element being sorted according to the comparison predicate. If the heap property is satisfied, the sorting is complete.
Step 5. If not, swap the heap location of the winning child with the element being sorted (the parent of the winning child) and continue with step 3.
The reading, comparing, swapping and writing of the elements to and from the array often takes considerable time until the sorting criteria is satisfied. Therefore, conventional time managers can take a long time to add elements to the heap and delete elements from the heap. Furthermore, the minimum period between successive expiration times is unacceptably long due to the bubble-down sort delays.
It would be desirable to implement a timer manager architecture based on a binary heap that supports a short minimum timer period and/or adds and deletes timers rapidly from the binary heap.